package com.qd.pandaparkflow.bean;

import com.qd.common.panda.domain.entity.feetime.BaseFeeTimeDTO;
import lombok.Data;
import lombok.ToString;
import lombok.experimental.Accessors;

import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.util.List;
import java.util.Optional;

/**
 * @author sjk
 */
@Data
@Accessors(chain = true)
@ToString
public class ChargeFeeParkTimeReqVO {
    private String id;
    /**
     * 开始时间
     */
    private LocalDateTime startTime;
    /**
     * 结束时间
     */
    private LocalDateTime endTime;
    /**
     * 金额
     */
    private BigDecimal amount;
    /**
     * 规则ID
     */
    private String feeTimeId;
    /**
     * 规则
     */
    private List<BaseFeeTimeDTO> feeTimeRules;

    public void freeData() {
        this.startTime = null;
        this.endTime = null;
        this.feeTimeId = null;
        this.amount = null;
        Optional.ofNullable(feeTimeRules).ifPresent(List::clear);
    }

}
